package com.catal.framework.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.catal.framework.pojo.Account;
import com.catal.framework.query.QueryService;

@Controller
@RequestMapping("/")
public class LoginController {

	private static final Logger logger = Logger.getLogger(LoginController.class);
	
	@Resource
	private QueryService userQueryService;
	/**
	 * 跳转到菜单管理页面
	 * 
	 * @return
	 */
	@RequestMapping(value="login",method=RequestMethod.POST)
	public String login(@RequestParam String username, @RequestParam String password, HttpSession session, HttpServletRequest request) {
		System.out.println(username);
		System.out.println(password);
		Account account = new Account();
		account.setUsername(username);
		account.setPassword(password);
		session.setAttribute("loginaccount", account);
		return "index";
	}
}
